import { View, Text,Button } from 'react-native'
import React, { useEffect, useState } from 'react'
import { SafeAreaView } from 'react-native-safe-area-context'

const Home = ({ navigation }) => {
  const [price,setPrice] = useState({
    totalPrice:true,
    number:0
  })

  const handleCount = ()=>{
    setPrice((prev)=>{
      return {
        ...prev,
        number:prev.number+15
      }
    })
  }

  
  // console.log('count',count)
  console.log('component rendering')
  return (
    <SafeAreaView className="flex-1 items-center justify-center">
      <View className="">
        <Text>
          <Button
            onPress={handleCount}
            title={price.number+''}
            color="#841584"
          />
        </Text>
        <Text className="text-blue-800" onPress={() => { navigation.navigate('My') }}>home</Text>
      </View>
    </SafeAreaView>
  )
}

export default Home